var myScroll;
var pagenum = 1, update = true,id;
function loaded() {
    setTimeout(function(){
        myScroll = new IScroll('#wrapper', { mouseWheel: true, click: true });
        myScroll.on('scrollStart',function(){   //开始滚动
            // alert(1);
        });
        myScroll.on('scroll',function(){  //滚动中
            // alert(1);
        });
        myScroll.on('scrollEnd', function () {
            //console.log(this.y +"|||"+this.maxScrollY);
            //如果滑动到底部，则加载更多数据（距离最底部10px高度）
            if ((this.y - this.maxScrollY) == 0) {
                getMore();
            }
        });
    },100 );
}
function getMore() {
    var that = document.getElementById("more");
    pagenum++;
    $.ajax({
        url: '/***/getPage',
        data: {'currentPage':pagenum},
        type: 'POST',
        datatype: "json",
        success: function (data) {
            //alert(data);
            var list = data.List;
            if (list.length < 1) {
                pagenum--; that.innerHTML = "已经没有更多了..."; return;
            }
            var ul = document.getElementById("thelist");
            for (var i = 0; i < list.length; i++) {
                var str = "<li>";
                str += "<div class=\"panelListItemForALL\"><table class=\"allRecordTable\"><tbody><tr><td>***</td><td>"+list[i].OrderCode+"</td>";
                str += "</tr><tr><td>***</td><td>"+list[i].GoodsName+"</td></tr>";
                str += "<tr><td>***</td><td>"+ data.DatatimeArray[i] +"</td>";
                str += "</tr></tbody></table></div>";
                str += "</li>";
                ul.innerHTML += str;
                myScroll.refresh();
            }
        }
    });

}

document.addEventListener('touchmove', function (e) {
    e.preventDefault();
}, isPassive() ? {
    capture: false,
    passive: false
} : false);

function show() {

}
function isPassive() {
    var supportsPassiveOption = false;
    try {
        addEventListener("test", null, Object.defineProperty({}, 'passive', {
            get: function () {
                supportsPassiveOption = true;
            }
        }));
    } catch (e) {
    }
    return supportsPassiveOption;
}
